package com.hkyl.hospital.web.controller;

import com.hkyl.hospital.domain.ResultVo;
import com.hkyl.hospital.entity.PatientMedicine;
import com.hkyl.hospital.service.PatientMedicineService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hyh
 * @date 2023/07/15 16:25:33
 */
@RestController
@RequestMapping("patientMedicine")
public class PatientMedicineController {

    @Autowired
    private PatientMedicineService patientMedicineService;
    private Logger log = LoggerFactory.getLogger(PatientMedicineController.class);
    @PostMapping("save")
    public ResultVo save(@RequestBody PatientMedicine patientMedicine){
        Integer rows = patientMedicineService.save(patientMedicine);
        return rows > 0 ? ResultVo.success("添加成功") : ResultVo.failure("添加失败");
    }
}
